from flask import Flask,jsonify
# 导入配置文件
from config import Config
from db import db1

app = Flask(__name__)

# 加载配置文件
app.config.from_object(Config)
# 跨域配置
from flask_cors import CORS
CORS(app)

# 测试添加展示
@app.route('/test')
def test():
    sql = "select * from workflow"
    res = db1.find_all(sql)
    return jsonify({'list':res})

@app.route('/add')
def add():
    sql1 = "insert into workflow values(0,'基本面顶起')"
    db1.update(sql1)
    sql = "select * from workflow"
    res = db1.find_all(sql)
    return jsonify({'list':res})


if __name__ == '__main__':
    app.run()
